package com.ttdc.service;

import java.util.List;

import org.junit.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;


import com.ttdc.mapper.TablMapper;

import com.ttdc.pojo.Tabl;
import com.ttdc.pojo.TablExample;

@Service
public class TablServiceImpl implements TablService {

	
	@Autowired
    private TablMapper tablMapper;
	private TablExample example;
	
	private ApplicationContext applicationContext;
	
	@Before
	public void setUp() throws Exception {
		applicationContext = new ClassPathXmlApplicationContext("classpath:springmvc.xml");
		tablMapper=(TablMapper) applicationContext.getBean("tablMapper");
		example=new TablExample();
		
	}
	
	@Override
	public int countByExample(TablExample example) {
		// TODO Auto-generated method stub
		return tablMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(TablExample example) {
		// TODO Auto-generated method stub
		return tablMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(Integer tbId) {
		// TODO Auto-generated method stub
		return tablMapper.deleteByPrimaryKey(tbId);
	}

	@Override
	public int insert(Tabl record) {
		// TODO Auto-generated method stub
		return tablMapper.insert(record);
	}

	@Override
	public int insertSelective(Tabl record) {
		// TODO Auto-generated method stub
		return tablMapper.insertSelective(record);
	}

	@Override
	public List<Tabl> selectByExample(TablExample example) {
		// TODO Auto-generated method stub
		return tablMapper.selectByExample(example);
	}

	@Override
	public Tabl selectByPrimaryKey(Integer tbId) {
		// TODO Auto-generated method stub
		return tablMapper.selectByPrimaryKey(tbId);
	}

	@Override
	public int updateByExampleSelective(Tabl record, TablExample example) {
		// TODO Auto-generated method stub
		return tablMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Tabl record, TablExample example) {
		// TODO Auto-generated method stub
		return tablMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Tabl record) {
		// TODO Auto-generated method stub
		return tablMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Tabl record) {
		// TODO Auto-generated method stub
		return tablMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Tabl> selectByAll() {
		// TODO Auto-generated method stub
		return tablMapper.selectByAll();
	}

}
